package com.ustc.hewei.nettyrpc2_0.common.exception;

import com.ustc.hewei.nettyrpc2_0.common.enumeration.RpcError;

/**
* @description: 自定义Rpc异常
* @author hewei
* @date 2022/9/5 20:14
* @version 1.0
*/

public class RpcException extends RuntimeException {
    public RpcException(RpcError error, String detail) {
        super(error.getMassage() + ":" + detail);
    }

    public RpcException(RpcError error) {
        super(error.getMassage());
    }

    public RpcException(RpcError error, Throwable e) {
        super(error.getMassage() + ":" + e.getMessage(), e);
    }
}
